home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 January: Mac OS SDK / Dev.CD Jan 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / RIncludes / ConditionalMacros.r < prev    next >
Encoding:
Text File  |  1997-08-12  |  7.6 KB  |  191 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        ConditionalMacros.r
  3.  
  4.      Contains:    Set up for compiler independent conditionals
  5.  
  6.      Version:    Technology:    Universal Interface Files 3.0.1
  7.                  Release:    Universal Interfaces 3.0.1
  8.  
  9.      Copyright:    © 1993-1997 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. */
  18.  
  19. #ifndef __CONDITIONALMACROS_R__
  20. #define __CONDITIONALMACROS_R__
  21.  
  22. /****************************************************************************************************
  23.     UNIVERSAL_INTERFACES_VERSION
  24.     
  25.         0x0301 => version 3.0.1
  26.         0x0300 => version 3.0
  27.         0x0210 => version 2.1
  28.         This conditional did not exist prior to version 2.1
  29. ****************************************************************************************************/
  30. #define UNIVERSAL_INTERFACES_VERSION 0x0301
  31.  
  32. /****************************************************************************************************
  33.  
  34.     TARGET_CPU_≈    
  35.     These conditionals specify which microprocessor instruction set is being
  36.     generated.  At most one of these is true, the rest are false.
  37.  
  38.         TARGET_CPU_PPC            - Compiler is generating PowerPC instructions
  39.         TARGET_CPU_68K            - Compiler is generating 680x0 instructions
  40.         TARGET_CPU_X86            - Compiler is generating x86 instructions
  41.         TARGET_CPU_MIPS            - Compiler is generating MIPS instructions
  42.         TARGET_CPU_SPARC        - Compiler is generating Sparc instructions
  43.         TARGET_CPU_ALPHA        - Compiler is generating Dec Alpha instructions
  44.  
  45.  
  46.     TARGET_OS_≈    
  47.     These conditionals specify in which Operating System the generated code will
  48.     run. At most one of the these is true, the rest are false.
  49.  
  50.         TARGET_OS_MAC            - Generate code will run under Mac OS
  51.         TARGET_OS_WIN32            - Generate code will run under 32-bit Windows
  52.         TARGET_OS_UNIX            - Generate code will run under some unix 
  53.  
  54.  
  55.     TARGET_RT_≈    
  56.     These conditionals specify in which runtime the generated code will
  57.     run. This is needed when the OS and CPU support more than one runtime
  58.     (e.g. MacOS on 68K supports CFM68K and Classic 68k).
  59.  
  60.         TARGET_RT_LITTLE_ENDIAN    - Generated code uses little endian format for integers
  61.         TARGET_RT_BIG_ENDIAN    - Generated code uses big endian format for integers     
  62.         TARGET_RT_MAC_CFM        - TARGET_OS_MAC is true and CFM68K or PowerPC CFM being used    
  63.         TARGET_RT_MAC_68881        - TARGET_OS_MAC is true and 68881 floating point instructions used    
  64.  
  65.  
  66.     PRAGMA_≈
  67.     These conditionals specify whether the compiler supports particular #pragma's
  68.     
  69.         PRAGMA_IMPORT             - Compiler supports: #pragma import on/off/reset
  70.         PRAGMA_ONCE              - Compiler supports: #pragma once
  71.         PRAGMA_STRUCT_ALIGN      - Compiler supports: #pragma options align=mac68k/power/reset
  72.         PRAGMA_STRUCT_PACK        - Compiler supports: #pragma pack(n)
  73.         PRAGMA_STRUCT_PACKPUSH    - Compiler supports: #pragma pack(push, n)/pack(pop)
  74.         PRAGMA_ENUM_PACK         - Compiler supports: #pragma options(!pack_enums)
  75.         PRAGMA_ENUM_ALWAYSINT     - Compiler supports: #pragma enumsalwaysint on/off/reset
  76.         PRAGMA_ENUM_OPTIONS        - Compiler supports: #pragma options enum=int/small/reset
  77.  
  78.     FOUR_CHAR_CODE
  79.     This conditional does the proper byte swapping to assue that a four character code (e.g. 'TEXT')
  80.     is compiled down to the correct value on all compilers.
  81.  
  82.         FOUR_CHAR_CODE('abcd')    - Convert a four-char-code to the correct 32-bit value
  83.  
  84.     TYPE_≈
  85.     These conditionals specify whether the compiler supports particular types.
  86.  
  87.         TYPE_LONGLONG            - Compiler supports "long long" 64-bit integers
  88.         TYPE_BOOL                - Compiler supports "bool"
  89.         TYPE_EXTENDED            - Compiler supports "extended" 80/96 bit floating point
  90.  
  91. ****************************************************************************************************/
  92.  
  93.  
  94.  
  95. /*
  96.     Rez resource compiler from Apple Computer, Inc.    
  97. */
  98. #define TARGET_CPU_PPC              0
  99. #define TARGET_CPU_68K              0
  100. #define TARGET_CPU_X86              0
  101. #define TARGET_CPU_MIPS             0
  102. #define TARGET_CPU_SPARC             0
  103. #define TARGET_OS_MAC                1
  104. #define TARGET_OS_WIN32                0
  105. #define TARGET_OS_UNIX                0
  106. #define TARGET_RT_LITTLE_ENDIAN        0
  107. #define TARGET_RT_BIG_ENDIAN        1
  108. #define TARGET_RT_MAC_CFM            0
  109. #define TARGET_RT_MAC_68881            0
  110. #define PRAGMA_ONCE                    0
  111.  
  112.  
  113.  
  114. /****************************************************************************************************
  115.     Backward compatibility for clients expecting 2.x version on ConditionalMacros.h
  116.  
  117.     GENERATINGPOWERPC        - Compiler is generating PowerPC instructions
  118.     GENERATING68K            - Compiler is generating 68k family instructions
  119.     GENERATING68881            - Compiler is generating mc68881 floating point instructions
  120.     GENERATINGCFM            - Code being generated assumes CFM calling conventions
  121.     CFMSYSTEMCALLS            - No A-traps.  Systems calls are made using CFM and UPP's
  122.     PRAGMA_ALIGN_SUPPORTED    - Compiler supports: #pragma options align=mac68k/power/reset
  123.     PRAGMA_IMPORT_SUPPORTED    - Compiler supports: #pragma import on/off/reset
  124.  
  125. ****************************************************************************************************/
  126. #define GENERATINGPOWERPC TARGET_CPU_PPC
  127. #define GENERATING68K TARGET_CPU_68K
  128. #define GENERATING68881 TARGET_RT_MAC_68881
  129. #define GENERATINGCFM TARGET_RT_MAC_CFM
  130. #define CFMSYSTEMCALLS TARGET_RT_MAC_CFM
  131. /*
  132.     NOTE: The FOR_≈ conditionals were developed to produce integerated
  133.           interface files for System 7 and Copland.  Now that Copland
  134.           is canceled, all FOR_ conditionals have been removed from
  135.           the interface files.  But, just in case you someone got an 
  136.           interface file that uses them, the following sets the FOR_≈
  137.           conditionals to a consistent, usable state.
  138. */
  139. #define FOR_OPAQUE_SYSTEM_DATA_STRUCTURES 0
  140. #ifndef FOR_PTR_BASED_AE
  141. #define FOR_PTR_BASED_AE 0
  142. #endif
  143. #define FOR_SYSTEM7_ONLY 1
  144. #define FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED 1
  145. #define FOR_SYSTEM7_AND_SYSTEM8_COOPERATIVE 1
  146. #define FOR_SYSTEM7_AND_SYSTEM8_PREEMPTIVE 1
  147. #define FOR_SYSTEM8_COOPERATIVE 0
  148. #define FOR_SYSTEM8_PREEMPTIVE 0
  149.  
  150.  
  151.  
  152. /****************************************************************************************************
  153.  
  154.     OLDROUTINENAMES            - "Old" names for Macintosh system calls are allowed in source code.
  155.                               (e.g. DisposPtr instead of DisposePtr). The names of system routine
  156.                               are now more sensitive to change because CFM binds by name.  In the 
  157.                               past, system routine names were compiled out to just an A-Trap.  
  158.                               Macros have been added that each map an old name to its new name.  
  159.                               This allows old routine names to be used in existing source files,
  160.                               but the macros only work if OLDROUTINENAMES is true.  This support
  161.                               will be removed in the near future.  Thus, all source code should 
  162.                               be changed to use the new names! You can set OLDROUTINENAMES to false
  163.                               to see if your code has any old names left in it.
  164.     
  165.     OLDROUTINELOCATIONS     - "Old" location of Macintosh system calls are used.  For example, c2pstr 
  166.                               has been moved from Strings to TextUtils.  It is conditionalized in
  167.                               Strings with OLDROUTINELOCATIONS and in TextUtils with !OLDROUTINELOCATIONS.
  168.                               This allows developers to upgrade to newer interface files without 
  169.                               having to change the includes in their source code.  But, it allows
  170.                               the slow migration of system calls to more understandable file locations.  
  171.                               OLDROUTINELOCATIONS currently defaults to true, but eventually will 
  172.                               default to false.
  173.  
  174. ****************************************************************************************************/
  175. #ifndef OLDROUTINENAMES
  176. #define OLDROUTINENAMES 0
  177. #endif
  178. #ifndef OLDROUTINELOCATIONS
  179. #define OLDROUTINELOCATIONS 0
  180. #endif
  181.  
  182.  
  183. #define CGLUESUPPORTED    0
  184.  
  185.  
  186.  
  187.  
  188.  
  189. #endif /* __CONDITIONALMACROS_R__ */
  190.  
  191.